package com.hqd.ch03.v51.core.type.filter;

import com.hqd.ch03.v51.core.type.ClassMetadata;

import java.util.regex.Pattern;

public class RegexPatternTypeFilter extends AbstractClassTestingTypeFilter {

    private final Pattern pattern;


    public RegexPatternTypeFilter(Pattern pattern) {
        this.pattern = pattern;
    }


    @Override
    protected boolean match(ClassMetadata metadata) {
        return this.pattern.matcher(metadata.getClassName()).matches();
    }

}